package com.chiancloud.shield.core.persist;


import com.chiancloud.shield.core.conf.ConfTree;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;

import java.io.IOException;

/**
 * Conf tree to JSON binding
 */
public class ConfTreeSerDeser extends JsonSerDeser<ConfTree> {
  public ConfTreeSerDeser() {
    super(ConfTree.class);
  }


  private static final ConfTreeSerDeser staticinstance = new ConfTreeSerDeser();
  public static String toString(ConfTree instance) throws IOException,
                                                          JsonGenerationException,
                                                          JsonMappingException {
    synchronized (staticinstance) {
      return staticinstance.toJson(instance);
    }
  }
}
